transformer un dictionnaire en liste python

73

# A list of the keys of dictionary
list_keys = [ k for k in dict ]
 
# or a list of the values
list_values = [ v for v in dict.values() ]
 
# or just a list of the list of key value pairs
list_key_value = [ [k,v] for k, v in dict.items() ]

Comments

Submit
0 Comments